layui.define(["serializeJson"], function (exports) {
    var $ = layui.jquery;
    // 把第一行的 ;(function($, window, document, undefined){ 换成以上
    //...扩展内容

    //$.fn.serializeJson = function () {
    var serializeObj = {};
    var array = $(this).serializeArray();
    $.each(array, function () {
        if (serializeObj[this.name] !== undefined) {
            if (!serializeObj[this.name].push) {
                serializeObj[this.name] = [serializeObj[this.name]];
            }
            serializeObj[this.name].push(this.value || '');
        } else {
            serializeObj[this.name] = this.value || '';
        }
    });
    var obj = serializeObj;

    exports("serializeJson", obj);
});